import Vue from 'vue'
import VueRouter from 'vue-router'

import Index from '@/components/Index.vue'

import User from '@/components/User.vue'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:'index'
  },{
    path: '/index',
    name: 'index',
    component: Index,

    //添加子路由
    children:[
      {
        path: "/user",
        name: "user",
        component:User
      }
    ]
  }
];

const router = new VueRouter({
  routes
});

export default router
